﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class GrantRole
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            pg.Type = "GrantRole";
            pg.SMenuId = "CS02";
            HttpSessionState session = System.Web.HttpContext.Current.Session;
            pg.dict = BasePage.getDict(session);
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
            pg.KeyFieldName = "id";
            pg.TableName = "tb_sys_role";
            pg.Sql = "select * from (select srolecode as id,srolename as name from tb_sys_role) tb_sys_role where 1=1";
            ColumnInfo cl;
            cl = new ColumnInfo(); cl.FieldName = "id"; cl.HeadText = "角色ID"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.FieldName = "name"; cl.HeadText = "角色名称"; pg.AddColumn(cl);
            return pg;
        }
    }
}